package com.company.project.core.ocr;

/**
 * =================================
 * <p>
 * Created by cjj on 20-9-29.
 * <p>
 * 描述: 合合信息OCR识别服务
 */

public class OCRRecService {

    private static BdOCRRecService bdOCRRecService = new BdOCRRecService();
    private static HeheOCRRecService heheOCRRecService = new HeheOCRRecService();


    public static String recPdfStr(String ocrRecUrl, String path) throws Exception {
        IOCRService iocrService = recSup();
        return HeheOCRRecService.recPdfStr(ocrRecUrl, path);
    }

    public static String recStr(String url, String filePath) throws Exception {
        IOCRService iocrService = recSup();
        return iocrService.recStr(url, filePath);
    }

    public static RotatedImageDTO rec(String url, String filePath) throws Exception {
        IOCRService iocrService = recSup();
        return iocrService.rec(url, filePath);
    }

    private static IOCRService recSup() {
        //查看系统是否支持ocr识别
        return heheOCRRecService;
    }

    public static void main(String[] args) throws Exception {
        String filePath = "/home/cjj/图片/选区_003.png";
        //String rec = recStr(ORC_URL, filePath);
        //System.out.println(rec);

        String s = recPdfStr("", filePath);
        System.out.println(s);
    }


}
